<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./vue.global.js"></script>
</head>

<body>
  <div id="app"></div>
  <script>
    let { createApp, reactive, h } = Vue

    let App = {
      setup() {
        let state = reactive({ xxx: 12 })
        return () => {
          return h('div', { style: { color: 'red' } }, state.xxx + "")
        }
      }
    }
    /* 组件的setup函数返回一个 函数 执行函数得到带有虚拟DOM的对象
    anchor: null
    appContext: null
    children: "12"
    component: null
    dirs: null
    dynamicChildren: null
    dynamicProps: null
    el: null
    key: null
    patchFlag: 0
    props:
      style:
      color: "red"
      __proto__: Object
      __proto__: Object
    ref: null
    scopeId: null
    shapeFlag: 9
    ssContent: null
    ssFallback: null
    staticCount: 0
    suspense: null
    target: null
    targetAnchor: null
    transition: null
    type: "div"
    __v_isVNode: true
    __v_skip: true
    */
    createApp(App).mount("#app")
  </script>
</body>

</html>